## This script provides replication data for Appendix Table 1 of "The Coevolution of Networks of Interstate Support, Interstate Threat and Civil War" 


rm(list=ls(all=TRUE))

#dir <- "[Directory Information Here]"
dir <- "C:/Users/rapiduser/Box/Relation creation/JOPreplication/"


setwd(dir)


## Import the network and monadic data in two separate objects
nets.total <- read.csv("relation_network.csv", header=TRUE, row.names=1)
mons.total <- read.csv("relation_nodal.csv", header=TRUE, row.names=1)
compchanges <- read.csv("compchanges.csv", header=TRUE, row.names=1)

#Get descriptive statistics for Appendix Table 1
summary(nets.total[nets.total$ccode1!=nets.total$ccode2,])
summary(mons.total)
sd(nets.total$threat_bin_3[nets.total$ccode1!=nets.total$ccode2],na.rm = T)
sd(nets.total$support_bin[nets.total$ccode1!=nets.total$ccode2],na.rm = T)
sd(nets.total$contiguous,na.rm = T)
sd(nets.total$idealpointdistance,na.rm = T)
sd(nets.total$IGOcommon,na.rm = T)
sd(mons.total$intra_intens,na.rm = T)
sd(mons.total$dem,na.rm = T)
sd(mons.total$mmp_change,na.rm = T)
sd(mons.total$energypc,na.rm = T)
sd(mons.total$mi1,na.rm = T)
sd(mons.total$support_mi,na.rm = T)
sd(mons.total$threat_mi,na.rm = T)
sd(mons.total$support_ipcloseness,na.rm = T)
sd(mons.total$support_IGO,na.rm = T)


